package com.ljy.springcloud.controller;

import com.ljy.springcloud.entities.CommonResult;
import com.ljy.springcloud.entities.Payment;
import com.ljy.springcloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class PaymentController {
    @Autowired
    PaymentService paymentService;

    @GetMapping("/consumer/payment/find/{id}")
    public CommonResult<Payment> find(@PathVariable(name = "id") int id) {
        log.info("===id:{}", id);
        /*Payment payment = paymentService.find(id);
        if (payment!=null){
            return new CommonResult<>(200,"查询成功",payment);
        }
        return new CommonResult<>(444,"未查到",null);*/
        return paymentService.find(id);
    }
}
